package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CoachMapper;
import com.ruoyi.system.domain.Coach;
import com.ruoyi.system.service.ICoachService;

/**
 * 教练列表Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-11-28
 */
@Service
public class CoachServiceImpl implements ICoachService 
{
    @Autowired
    private CoachMapper coachMapper;

    /**
     * 查询教练列表
     * 
     * @param id 教练列表主键
     * @return 教练列表
     */
    @Override
    public Coach selectCoachById(Long id)
    {
        return coachMapper.selectCoachById(id);
    }

    /**
     * 查询教练列表列表
     * 
     * @param coach 教练列表
     * @return 教练列表
     */
    @Override
    public List<Coach> selectCoachList(Coach coach)
    {
        return coachMapper.selectCoachList(coach);
    }

    /**
     * 新增教练列表
     * 
     * @param coach 教练列表
     * @return 结果
     */
    @Override
    public int insertCoach(Coach coach)
    {
        coach.setCreateTime(DateUtils.getNowDate());
        return coachMapper.insertCoach(coach);
    }

    /**
     * 修改教练列表
     * 
     * @param coach 教练列表
     * @return 结果
     */
    @Override
    public int updateCoach(Coach coach)
    {
        return coachMapper.updateCoach(coach);
    }

    /**
     * 批量删除教练列表
     * 
     * @param ids 需要删除的教练列表主键
     * @return 结果
     */
    @Override
    public int deleteCoachByIds(Long[] ids)
    {
        return coachMapper.deleteCoachByIds(ids);
    }

    /**
     * 删除教练列表信息
     * 
     * @param id 教练列表主键
     * @return 结果
     */
    @Override
    public int deleteCoachById(Long id)
    {
        return coachMapper.deleteCoachById(id);
    }
}
